<?php
/**
 * Author   : 葫芦瓢子 <gourdladle@163.com>
 * Date     : 2023-07-03
 * Wechat   : skymouses
 * License  : MIT
 */

namespace GourdLadle\PhinxTp\seed;

use GourdLadle\PhinxTp\Phinx;
use think\console\Input;
use think\console\Output;
use think\console\input\Argument;

class Create extends Phinx
{
    protected function configure()
    {
        $this->setName('phinx:seed:create')
            ->setDescription('创建一个数据文件')
            ->addArgument('className', Argument::REQUIRED, '迁移数据');
    }

    protected function execute(Input $input, Output $output)
    {
        $commandName = 'seed:create';
        $arg = [
            'command' => $commandName,
            'name' => $input->getArgument('className'),
        ];
        $this->runPhinx($commandName, $arg);
    }
}
